package com.ljcalc.business.components;

import java.util.*;

import junit.framework.*;

public class RandomPoolTest extends TestCase {
	
	public void setUp() throws Exception{
		
	}
	
	public void tearDown() throws Exception{
		
	}
	
	public void testRandomPool() {
		ArrayList<Long> list = new ArrayList<Long>();
		
		list.add(new Long(1));
		list.add(new Long(2));
		list.add(new Long(3));
		list.add(new Long(4));
		list.add(new Long(5));
		
		RandomPool pool = new RandomPool(list);
		assertEquals(1, pool.getNextRandomValue()); 
		assertEquals(2, pool.getNextRandomValue());
		assertEquals(3, pool.size());
		assertEquals(3, pool.getNextRandomValue());
		assertEquals(4, pool.getNextRandomValue());
		assertEquals(5, pool.getNextRandomValue());
		assertEquals(0, pool.size());
	}
}
